package cn.lzy.demo;

import cn.lzy.demo.config.JavaConfig2;
import cn.lzy.demo.service.AccountService;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * @Description Java配置+XML配置混合搭配实现声明式事务
 * @Author lzy
 * @Date 2024/1/2 16:32
 * @Version
 **/
public class TestDemoJava02 {

    // 运行时需要注释掉 JavaConfig，因为 JavaConfig2 有配置扫描包
    public static void main(String[] args) {
        AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext(JavaConfig2.class);
        AccountService accountService = ctx.getBean(AccountService.class);
        accountService.transferMoney("yss", "lzy", 100.0);
    }
}
